package com.esms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.esms.dao.BonusMapper;
import com.esms.dao.DepartmentMapper;
import com.esms.dao.EmployeeMapper;
import com.esms.dao.GrandMapper;
import com.esms.po.Aassessment;
import com.esms.po.Bonus;
import com.esms.po.Department;
import com.esms.po.Employee;
import com.esms.po.Fassessment;
import com.esms.po.Grand;
import com.esms.service.IEmployeeBonusServer;
import com.esms.service.IEmployeeGrandServer;

@Service
public class EmployeeBonusServerImpl implements IEmployeeBonusServer {
	@Autowired
    private BonusMapper bonusMapper = null;
	@Autowired
    private EmployeeMapper employeeMapper = null;
	@Autowired
    private DepartmentMapper departmentMapper = null;
	
    @Override
	public List<Bonus> getEmployeeBonusList(String eId,int FdId, String fEid) {
    	if(FdId == 0) {
    		return bonusMapper.selectBypIdAnddId(eId, fEid);
    	}else {
    		return bonusMapper.selectBypIdAnddIdAndfEid(eId,FdId,fEid);
    	}
	}
    
    @Override
    public int updateBonusList(Bonus bonus) {
         return  bonusMapper.updateBysId(bonus); 
    
    }
    
    @Override
    public int deleteBonus(String aAuserid , String aDuserid) {
         return  bonusMapper.deleteBonus(aAuserid, aDuserid);
    
    }
    
    @Override
    public int insertBonus(Fassessment fassessment) {
         return  bonusMapper.insertBonus(fassessment); 
    
    }
    public String getDBaccount() {
    	return bonusMapper.selectByStat(1,1);
    }
}
